home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
pascal
/
makescrn.zip
/
MAKESCRN.DOC
next >
Wrap
Text File
|
1989-08-27
|
6KB
|
110 lines
MakeScrn - a text screen painting utility
Written by Steve Sneed
Released to the Public Domain 27-Aug-89
-----------------------------------------
REQUIRES: Turbo Pascal 5.x and the TurboPower Professional 5.0x libraries
--------
Ever wish you could quickly "paint" a text screen the way you can a graphics
screen? And then save it in the TurboPower Professional "Packed Window"
format for later use in a program?
I came on board in a new job recently, as was handed a TP project that used
over 50 different screens. Another programmer that was leaving the company
had done about 15% of the screens already, and had done them the hard way -
coding the actual TP and TPro screen manipulation procedures/functions to
draw the screen in the program and then save the screen to packed format.
She had taken at least a day per screen; juggling prompt positions, trying
attributes, starting over when she decided it wasn't what she wanted or when
one of the other programmers made a change to data formats or other info to
be displayed on the screen, etc. I know there had to be a better way... here
it is.
MakeScrn is a simple little program provided in source format that allows you
to draw frames, enter text, change attributes, move portions of the screen
around and generally "paint" what you want using similar commands to what you
will find in many graphics paint programs. Screens you create in the program
can be saved to disk as a "packed screen" using the routines in the TurboPower
Professional 5.0x libraries, and can be reloaded for further work.
Certainly there are other features that could be added to the program, and
"gee-whiz" changes that could be made to the existing routines (I'd like to
add the ability to rubberband frames, for example.) I leave these for you
to experiment with, for I hope this can be a learning tool as well as a
functional program (that's why I provide it in source form only!)
--------
Here's a basic outline of the program:
When you execute the program, you are presented with a blank screen and the
menu of commands in the upper right-hand corner. Pressing the first char of
the command name executes that command. The available commands are:
C)hange attributes - Change the display attributes (foreground and background
colors) for an area. You select the area to change by
first "dropping anchor" in the upper-left corner of the
area by moving the cursor to that spot and pressing
[Enter] or [LeftButton], then use the cursor keys or
mouse to move to the lower-right corner and press [Enter]
or [LeftButton] to define the area. The area can be any
region from a single character cell to the entire screen.
Once the area is defined, a map of screen attributes is
displayed; the hex numbers going down the side of the map
are the background values, the hex numbers across the top
are the foreground attributes. Enter a 2-digit hex value
for the new attribute (background value first) at the
prompt in the lower left corner of the screen and the
area will change to that value. At any time during the
process, you can press [Esc] or [RightButton] to abort
the whole process.
D)raw Frame - Makes it easy to frame a window. Just like the C)hange
attribute command, you drop anchor at the upper left
corner and then drop anchor again at the lower right
corner; the frame will be drawn.
E)rase Area - Erases all text characters from the area defined by
dropping anchors. The underlying attributes are not
changed.
F)rame Chars - Allows you to change between the four common frame char
sets.
I)nput Text - Allows you to input text on the screen. The only editing
command available is the backspace. Drop anchor where
you want the text to start, and type. Press [Esc] or
[RightButton] when complete.
L)oad Screen - Loads an existing screen from a file. You are prompted
for the name of the file. Note that you can automatically
load a screen when you execute the program by providing
its name on the command line.
M)ove Area - Allows movement of a region of the screen from one X-Y
location to another. Define the area by dropping anchors,
then place the cursor at the upper left corner of the
new location for the region and press [Enter] of [Left-
Button] to move. The area is forced to within the cur-
rent screen boundries.
Q)uit - As its name implies, this exits the program. The current
screen contents are NOT saved; be sure to use the S)ave
Screen command if you need to do so.
V)iew - Just hides the menu so you can see the entire screen.
Pressing [Enter], [Esc], [LeftButton] or [RightButton]
restores the menu.
S)ave Screen - Saves the current screen to a file. You are prompted for
the filename to save. This file will be in the Turbo
Power "packed window" format for easy use in another
program. NOTE: I recommend that you give the screen file
a name that will make it easy to later incluude in a
"packed screen library" using the other routines in the
TpCrt unit.